package IOPeration;

import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class Returnbook implements Ioperation{
    public void work(BookList bookList){
        System.out.println("归还图书");
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入你要归还的图书名字");
        String name=scanner.nextLine();
        int currenTsize= bookList.getUsedsize();
        for(int i=0;i<currenTsize;i++){
            Book book=bookList.getBooks(i);
            if(book.getName().equals(name)){
                System.out.println("你要归还的图书归还成功");
            }
        }
        System.out.println("没有你要归还的图书");
    }
}
